﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tester.Models;
internal class Navigate
{
    private static Dictionary<string, Action<Type>> actions = new Dictionary<string, Action<Type>>();

    public static void Register(Action<Type> action, string key)
    {
        if (!actions.ContainsKey(key))
        {
            actions.Add(key, action);
        }
    }

    public static void Execute(string key, Type pagetype)
    {
        if (actions.ContainsKey(key))
        {
            actions[key]?.Invoke(pagetype);
        }
    }
}
